package Service.Impl;

import Dao.UserDao;
import POJO.InputPOJO.UserPage;
import POJO.User;
import POJO.Vo.UserVo;
import Service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Resource
    UserDao userDao;

    @Override
    public void insertUser(User user) {
        userDao.insertUser(user);
    }

    @Override
    public List<UserVo> userList(UserPage userPage) {
        List<UserVo> list=userDao.userList(userPage);
        return list;
    }

    @Override
    public int userListTotal(UserPage userPage) {
        return userDao.userListTotal(userPage);
    }

    @Override
    public void updateUser(User user) {
        userDao.updateUser(user);

    }

    @Override
    public UserVo selectUserById(long userId) {
        return userDao.selectUserById(userId);
    }

    @Override
    public void deleteUser(int userId) {
        userDao.deleteUser(userId);
    }


    @Override
    public UserVo logon(User user) {
        return  userDao.logon(user);
    }
    @Override
    public  UserVo logonCheck(User user){
        return userDao.logonCheck(user);
    }
}
